
Partial Class UpdateProducts
    Inherits System.Web.UI.Page

    Sub btnNewItem_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        DetailsView1.ChangeMode(DetailsViewMode.Insert)
    End Sub

    Sub SqlDataSource2_Inserted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
        DataList1.DataBind()
        DetailsView1.DataBind()
    End Sub

    Sub SqlDataSource2_Updated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
        DataList1.DataBind()
        DetailsView1.DataBind()
    End Sub

    Sub FileUploaded(ByVal sender As Object, ByVal e As PictureUpload.FileUploadEventArgs)

        Dim boundControl As TextBox = CType(DetailsView1.FindControl("txtPictureURL"), TextBox)
        boundControl.Text = e.FileName

    End Sub

    Sub SqlDataSource2_Deleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs)
        DataList1.DataBind()
        DetailsView1.DataBind()
    End Sub

End Class
